﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Summer.Core.Ioc;

#region License
/*
 *  Copyright (c) Dumuzi.cn 2009 , All rights reserved.
 *  CLR Version: 2.0.50727.4927
 *  NameSpace: Summer.Windows.Support
 *  Author:Edwin Tai,戴佳顺
 *  Msn:edwin19861218@hotmail.com
 *  QQ: 1961218
 *  Date:2009-11-10 23:22:33
 *  Licensed under the Microsoft Public License (Ms-PL)
 *  This license governs use of the accompanying software. 
 *  If you use the software, you accept this license.
 *  If you do not accept the license, do not use the software.
 */
#endregion

namespace Summer.Windows.Support
{
   public class SummerWindowsApplication
    {
       private string m_contextxml;

       public SummerWindowsApplication(string contextxml)
       {
           this.m_contextxml = contextxml;
       }
       public void ApplicationStart()
       {
           ApplicationStateSupport.LoadContainer(m_contextxml, Configuration);
       }
       public void ApplicationEnd()
       {
           ApplicationStateSupport.UnloadContainer();
       }

       private IocConfiguration m_configuration;
        /// <summary>
        /// Load configuration 
        /// </summary>
       public IocConfiguration Configuration
       {
           set { this.m_configuration = value; }
           get
           {
               if (this.m_configuration == null)
               {
                   return new IocConfiguration();
               }
               return m_configuration;
           }
       }
        
    }
}
